package com.efesco.crm.quotation;

import com.bstek.dorado.data.*;
import com.bstek.dorado.view.data.ViewField;
import com.bstek.dorado.common.*;
import com.efesco.common.Tools;

/**
 * SelectQuotationDropdown_datasetConditionListener
 */
public class SelectQuotationDropdown_datasetConditionListener extends AbstractDatasetListener {
  public boolean beforeLoadData(Dataset dataset) throws Exception {
	  DoradoContext context = DoradoContext.getContext();
	  String comId=context.getParameter("single_company_id");
	  
	  ViewField field=(ViewField)dataset.getField("company_chinese_name");
	  if(!Tools.toStr(comId).equals("")){
		  dataset.insertRecord();
		  dataset.setValue("single_company_id",comId);
		  field.setVisible(false);
	  }  
      return true;
  }

  public void afterLoadData(Dataset dataset)
     throws Exception {

  }

}
